package com.ruoyi.datastatistics.service;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

import com.ruoyi.basedata.domain.vo.UserTerminalsRequestVO;
import com.ruoyi.datastatistics.domain.Bill;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.datastatistics.domain.BillBo;
import org.springframework.transaction.annotation.Transactional;

/**
 * 欠费明细Service接口
 *
 * @author zt
 * @date 2025-05-27
 */
public interface IBillService extends IService<Bill>
{
    /**
     * 查询欠费明细
     *
     * @param id 欠费明细主键
     * @return 欠费明细
     */
    public Bill selectBillById(Long id);

    /**
     * 查询欠费明细列表
     *
     * @param bill 欠费明细
     * @return 欠费明细集合
     */
    public List<Bill> selectBillList(Bill bill);
    public List<BillBo> selectBillListStat(Bill bill);

    /**
     * 新增欠费明细
     *
     * @param bill 欠费明细
     * @return 结果
     */
    public int insertBill(Bill bill);

    public int insertBill(String date,String userId);

    /**
     * 修改欠费明细
     *
     * @param bill 欠费明细
     * @return 结果
     */
    public int updateBill(Bill bill);

    /**
     * 批量删除欠费明细
     *
     * @param ids 需要删除的欠费明细主键集合
     * @return 结果
     */
    public int deleteBillByIds(Long[] ids);

    /**
     * 删除欠费明细信息
     *
     * @param id 欠费明细主键
     * @return 结果
     */
    public int deleteBillById(Long id);

    void updateBillByIds(Long[] ids);

    List<Bill> getBillList(String userId, Integer checkFlg);

    public Map<String, Object> checkBillForUser(String userId, String departureTime);
    public Map<String, Object> checkBillForOther(String userId, String departureTime);


    public int insertBillForUseLeve(String userId, String departureTime);

    @Transactional
    int insertUserDosageReportForMonth(String freezeTime);

    @Transactional
    int insertBillForMonth(String freezeTime);

    @Transactional
    int insertBillForDay(String freezeTime);

    int dealUserLeaveForinsertHistoryData(UserTerminalsRequestVO requestVO);

    int  synchronizationWaterData(List<String> terminalIds, LocalDateTime checkoutDate);

    int  synchronizationEletricityData(List<String> terminalIds, LocalDateTime checkoutDate);
}
